package com.gper.edu.scalatry
import scala.util.{Failure, Success, Try}
object TryDemo {

  def divideMethod(number: Int,number2:Int)={
    Try(number/number2)
  }

  def main(args: Array[String]): Unit = {
    val result = divideMethod(1,0)
    val message = result match {
      case Success(value) => "the result is :"+result.get
      case Failure(ex) => s"the error message :${ex.getMessage}"
    }
    println(message)
  }
}
